package com.woniuxy.person;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;
import org.springframework.core.io.FileSystemResource;
/**
* @Author: 马宇航
* @Todo: 使用ApplicationContext来获取配置文件
* @DateTime:  22/03/24/0024 上午 11:24
* @Component: 成都蜗牛学苑
**/
public class TestSpringFirst {
    public static void main(String[] args) {
        //第一种，通过项目路径获取配置文件
//        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");
        ApplicationContext applicationContext = new FileSystemXmlApplicationContext("C:\\Users\\ASUS\\Desktop\\86期的笔记\\project86\\day02IOC\\src\\applicationContext.xml");
        Person person = applicationContext.getBean("haonanren",Person.class);
        System.out.println(person);
    }
}
